Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻ refactor(IDistributedCache): Optimize connections under Isolation and Attempt to reconnect #740

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wzh425
Copy link
Contributor

@wzh425 wzh425 commented Oct 30, 2024

No description provided.

Copy link

sonarcloud bot commented Oct 30, 2024


namespace Masa.BuildingBlocks.Caching;

internal class DistributedCacheClientCache
Copy link
Contributor

@capdiem capdiem Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DistributedCacheClientCache的后缀Cache是OK的吗?你这是个工厂吧,改成ClientFactory?

{
public static ConcurrentDictionary<string, IManualDistributedCacheClient> CacheClients { get; set; } = new();

public IManualDistributedCacheClient GetCacheClient(IServiceProvider serviceProvider)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IHttpClientFactory用的时CreateClient,要对其它吗?

return _connection.GetDatabase();

throw new NotSupportedException("Redis service has been disconnected, please wait for reconnection and try again");
return EnsureDbConnection();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EnsureABC方法一般是返回void,里面可以抛异常。大概是这样:

EnsureABC();

return _connect.GetDatabase();

@wzh425 wzh425 marked this pull request as draft October 31, 2024 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants